package com.hengpeng.msls.config.vo;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;

@XStreamAlias("categoryKey")
public class CategoryKey implements Comparable<CategoryKey>
{
	@XStreamAsAttribute
	private String id;

	@XStreamAsAttribute
	private String name;

	@XStreamAsAttribute
	private Long sort;

	@Override
	public int compareTo(CategoryKey o)
	{
		int compare = sort.compareTo(o.getSort());
		return compare == 0 ? -1 : compare;
	}

	public String getId()
	{
		return id;
	}

	public void setId(String id)
	{
		this.id = id;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public Long getSort()
	{
		return sort;
	}

	public void setSort(Long sort)
	{
		this.sort = sort;
	}

	public static void main(String[] args)
	{
		Long a = 3l;
		Long b = 2l;
		System.out.println(a.compareTo(b));
	}
}
